{% extends 'layouts/base.html' %}

{% macro dashboard_option(title, endpoint, description=None, icon=None) %}
    <a class="column" href="{{ url_for(endpoint) }}">
        <div class="ui padded segment">
            <h3 class="ui header">
                {% if icon is not none %}
                    <i class="{{ icon }}"></i>
                {% endif %}
                <div class="content">
                    {{ title }}
                    {% if description is not none %}
                        <div class="sub header">
                            {{ description }}
                        </div>
                    {% endif %}
                </div>
            </h3>
        </div>
    </a>
{% endmacro %}

{% block content %}
    <div class="ui stackable centered grid container">
        <div class="twelve wide column">
            <h2 class="ui header">
                Admin Dashboard
            </h2>
            <div class="ui two column stackable grid">
                {{ dashboard_option('Registered Users', 'admin.registered_users',
                                    description='View and manage user accounts', icon='users icon') }}
                {{ dashboard_option('Add New User', 'admin.new_user',
                                    description='Create a new user account', icon='add user icon') }}
                {{ dashboard_option('Invite New User', 'admin.invite_user',
                                    description='Invites a new user to create their own account', icon='add user icon') }}
            </div>
        </div>
    </div>
{% endblock %}